
<!DOCTYPE html>
<!--
	RegexPal 0.1.4f
	(c) 2007-2014 Steven Levithan <http://stevenlevithan.com>
	Dual-licensed under MPL 2 and LGPL 3
-->
<html>
<head>
	<meta charset="utf-8"/>
	<title>Regex Tester - 一款JavaScript正则表达式测试工具</title>
	<link href="./assets/regexpal.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="header">
	<img src="./assets/regexpal.gif" alt="RegexPal"/>
	<h1><a href="./"><span class="t1">Regex</span><span class="t2">Pal</span>
		<span id="version">0.1.4</span>
		<span id="subtitle">&mdash; 一款JavaScript正则表达式测试工具</span></a>
	</h1>
	<ul id="nav">
		<li><a href="history.html" target="_blank">历史版本</a></li>
	</ul>
</div>

<div id="options">
	<ul>
		<li class="hidden"><input id="flagG" type="checkbox" checked="checked"/><label for="flagG">全局模式</label> <span class="flag">(g)</span></li>
		<li><input id="flagI" type="checkbox"/><label for="flagI">忽略大小写</label> <span class="flag">(i)</span></li>
		<li><input id="flagM" type="checkbox"/><label for="flagM">多行模式</label> <span class="flag">(m)</span></li>
		<li><input id="flagS" type="checkbox"/><label for="flagS">单行模式</label> <span class="flag">(s<span class="plain">; via <a href="http://xregexp.com/">XRegExp</a></span>)</span></li>
		<li class="optGroup" id="quickReferenceDropdown">快速参考</li>
		<li class="optGroup" id="optionsDropdown">选项
			<ul>
				<li><input id="highlightSyntax" type="checkbox" checked="checked"/><label for="highlightSyntax">高亮正则语句</label></li>
				<li><input id="highlightMatches" type="checkbox" checked="checked"/><label for="highlightMatches">高亮匹配</label></li>
				<li><input id="invertMatches" type="checkbox"/><label for="invertMatches" title="Highlight any text not matched by the regex">高亮未被匹配的字符串</label></li>
			</ul>
		</li>
	</ul>
</div>

<div id="quickReference" class="hidden">
	<h2>JavaScript正则快速参考</h2>
	<img class="pin" src="./assets/pin.gif" alt="pin" title="pin"/>
	<img class="close" src="./assets/close.gif" alt="close" title="close"/>
	<table cellspacing="0" summary="Regular expressions reference">
		<tbody>
		<tr>
			<td><code>.</code></td>
			<td>匹配除了换行字符.</td>
		</tr>
		<tr class="altBg">
			<td><code>\.</code></td>
			<td>A period (and so on for <code>\*</code>, <code>\(</code>, <code>\\</code>, etc.)</td>
		</tr>
		<tr>
			<td><code>^</code></td>
			<td>匹配字符串的开始.</td>
		</tr>
		<tr class="altBg">
			<td><code>$</code></td>
			<td>匹配字符串的结束.</td>
		</tr>
		<tr>
			<td><code>\d</code>,<code>\w</code>,<code>\s</code></td>
			<td>匹配一个数字,<code>[A-Za-z0-9_]</code>,空白符等不可见原子</td>
		</tr>
		<tr class="altBg">
			<td><code>\D</code>,<code>\W</code>,<code>\S</code></td>
			<td>匹配除了一个字母或数字或_或空白符.</td>
		</tr>
		<tr>
			<td><code>[abc]</code></td>
			<td>匹配a,b,c其中一个字母.</td>
		</tr>
		<tr class="altBg">
			<td><code>[a-z]</code></td>
			<td>匹配a-z之间的任意一个字母.</td>
		</tr>
		<tr>
			<td><code>[^abc]</code></td>
			<td>匹配除了a,b,c字母的字符串.</td>
		</tr>
		<tr class="altBg">
			<td><code>aa|bb</code></td>
			<td>匹配aa或者bb.</td>
		</tr>
		<tr>
			<td><code>?</code></td>
			<td>匹配出现0或者1次，与{0,1}等价.</td>
		</tr>
		<tr class="altBg">
			<td><code>*</code></td>
			<td>匹配出现0次或者更多次（无穷次），与{0,}等价.</td>
		</tr>
		<tr>
			<td><code>+</code></td>
			<td>出现1次或者更多次（无穷次），与{1,}等价.</td>
		</tr>
		<tr class="altBg">
			<td><code>{<em>n</em>}</code></td>
			<td>匹配出现<em>n</em>次，与{n}等价.</td>
		</tr>
		<tr>
			<td><code>{<em>n</em>,}</code></td>
			<td>匹配出现<em>n</em>或者更多次（无穷次），与{n,}等价.</td>
		</tr>
		<tr class="altBg">
			<td><code>{<em>m</em>,<em>n</em>}</code></td>
			<td>匹配出现<em>m</em>-<em>n</em>次，与{m,n}等价.</td>
		</tr>
		<tr>
			<td><code>??</code>,<code>*?</code>,<code>+?</code>,<br/><code>{<em>n</em>}?</code>, etc.</td>
			<td>同上，但比较少用.</td>
		</tr>
		<tr class="altBg">
			<td><code>(</code><em>表达式</em><code>)</code></td>
			<td>匹配时将<em>表达式</em>当作一个字符串使用.</td>
		</tr>
		<tr>
			<td><code>(?:</code><em>expr</em><code>)</code></td>
			<td>Non-capturing group.</td>
		</tr>
		<tr class="altBg">
			<td><code>(?=</code><em>expr</em><code>)</code></td>
			<td>Followed by <em>expr</em>.</td>
		</tr>
		<tr>
			<td><code>(?!</code><em>expr</em><code>)</code></td>
			<td>Not followed by <em>expr</em>.</td>
		</tr>
		</tbody>
	</table>
	<p><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp#Special_characters_in_regular_expressions" target="_blank">接近完整的参考</a></p>
</div>

<div id="body">
	<div id="search" class="smartField">
		<textarea cols="100" rows="3" tabindex="1" spellcheck="false">在这里写下你的正则表达式.它的语法将自动高亮显示.</textarea>
	</div>
	<div id="input" class="smartField">
		<textarea cols="100" rows="10" tabindex="2" spellcheck="false">在这里写你的测试数据.以黄色和蓝色高亮匹配.</textarea>
	</div>
</div>

<div id="footer" class="small">

	<p id="copyright">
		&copy; 2015 <a href="http://www.danstools.com/" target="_blank">Dan's Tools</a> | 汉化:<a href="//www.godcheese.com" target="_blank">天堂芝士</a> | 源地址:<a href="http://regexpal.com.s3-website-us-east-1.amazonaws.com/" target="_blank">http://regexpal.com.s3-website-us-east-1.amazonaws.com/</a>
	</p>
	<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?d0358443ab95cdab863fbed22f1adeca";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

</div>

<script src="./assets/xregexp.js"></script>
<script src="./assets/helpers.js"></script>
<script src="./assets/regexpal.js"></script>
</body>
</html>
